# main.py
from tools import base64_tool, json_tool, string_tool, data_tool, file_tool, hash_tool, http_tool

def show_menu():
    print("\n欢迎使用工具软件，请选择一个工具：")
    print("1. Base64 编解码")
    print("2. JSON 工具")
    print("3. 字符串操作")
    print("4. 数据处理")
    print("5. 文件操作")
    print("6. 哈希工具")
    print("7. HTTP 请求")
    print("0. 退出")
    return input("请输入选项（0-7）：")

def main():
    while True:
        choice = show_menu()
        if choice == "0":
            print("感谢使用，再见！")
            break
        elif choice == "1":
            base64_tool.run()
        elif choice == "2":
            json_tool.run()
        elif choice == "3":
            string_tool.run()
        elif choice == "4":
            data_tool.run()
        elif choice == "5":
            file_tool.run()
        elif choice == "6":
            hash_tool.run()
        elif choice == "7":
            http_tool.run()
        else:
            print("无效选项，请重新选择！")

if __name__ == "__main__":
    main()
